<!DOCTYPE html>
<html lang="">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Home</title>

    <script src="./vue/dist/vue.min.js"></script>
    <!-- Bootstrap CSS -->
    <link href="./bootstrap/dist/css/bootstrap.css" rel="stylesheet">
    <!-- jQuery -->
    <script src="./jquery/dist/jquery.min.js"></script>
    <!-- Bootstrap JavaScript -->
    <script src="./bootstrap/dist/js/bootstrap.min.js"></script>

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.3/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>



<div class="container-fluid" id="homeApp">

    <div class="row">

    <h3>应用</h3>
    <ul class="list-inline">
        <li>
            <a class="btn btn-primary" href="/books/home" role="button">图书管理</a>
        </li>
        <li>
            <a class="btn btn-primary" href="/files/home" role="button">文件管理</a>
        </li>
    </ul>


    </div>


</div>


</body>
</html>

<script>

    var vm = new Vue({
        el: '#homeApp',
        data: {
            bookList: []
        },
        methods: {
            
            all: function () {

                var _self = this;
                $.ajax({
                    crossDomain: true,
                    type: "get",
                    url: "http://localhost:9000/edoCate/all",
                    // data: "data",
                    dataType: "json",
                    success: function (response) {
                        console.log(response);
                        if (response.code == 0) {

                            _self.bookList = response.dat;
                            console.log(response);
                        }

                    }
                });
            }
        },
        mounted: function () {

            this.all();
        }
    })
</script>